From 0f9fb788d36a30b109e5024a4dd468448d88b161 Mon Sep 17 00:00:00 2001 From: robertl Date: Mon, 10 Jan 2005 01:54:37 +0000 Subject: [PATCH] From Jeremy. Allow encrypting hints & update README. --- README | 16 +++++++++++++++- vcf.c | 14 +++++++++++++- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/README b/README index fb6bf5894..4adeaecb1 100644 --- a/README +++ b/README @@ -647,7 +647,21 @@ THE FORMATS HSA Systems Endeavour Navigator format - will import both the old version 4.x binary files, and the newer XML based ones. - Only writes the new XML (5.0 and above) format. (use the .exp extension) + Only writes the new XML (5.0 and above) format. (use the .exp + extension) + + vCARD + + The vCard output is intended to be in a format that enables + waypoints to be viewed with an Apple iPod. This is achieved by + mapping waypoint fields into vCard fields that can be displayed + as 'Contacts' on the iPod. With the iPod mounted as a hard disk + (see your iPod manual for instructions), the resulting VCF + file should be moved into the iPod 'Contacts' folder. As an + alternative, Mac OS X users may prefer to drag the VCF file into + their address book and synchronize with the iPod using iSync. By + default hints are unencrypted; use the 'encrypt' option to + encrypt the hints. DATA FILTERS diff --git a/vcf.c b/vcf.c index 76002c986..8c1ad9a41 100644 --- a/vcf.c +++ b/vcf.c @@ -26,10 +26,14 @@ static FILE *file_out; static void *mkshort_handle; +static char *encrypt = NULL; + #define MYNAME "VCF" static arglist_t vcf_args[] = { + { "encrypt", &encrypt, + "Encrypt hints using ROT13", NULL, ARGTYPE_BOOL }, {0, 0, 0, 0, 0} }; @@ -72,8 +76,10 @@ static void vcf_print(const char *s) { char *p; + if (!s) return; + p = gstrsub(s, "\n", "\\n"); fputs(p, file_out); xfree(p); @@ -105,7 +111,13 @@ vcf_disp(const waypoint *wpt) fprintf(file_out, "\\n"); vcf_print_utf(&wpt->gc_data.desc_long); fprintf(file_out, "\\n\\nHINT:\\n"); - vcf_print(wpt->gc_data.hint); + if (encrypt) { + char *s = rot13(wpt->gc_data.hint); + vcf_print(s); + xfree(s); + } else { + vcf_print(wpt->gc_data.hint); + } fprintf(file_out, "\nEND:VCARD\n"); } -- 2.30.2